import { userStore } from './store/userStore'

function App() {
  const { user, setUser, loginCount, setLoginCount, channelList, getChannelList } = userStore()
  return (
    <div>
      <p>this is app</p>
      <p>user: {user}</p>
      <p>login count: {loginCount}</p>
      <p>
        <button onClick={() => setUser('new user')}>set user</button>
      </p>
      <p>
        <button onClick={() => setLoginCount(5)}>login count + 5</button>
      </p>
      <p>
        <button onClick={getChannelList}>get channel list</button>
      </p>
      <p>
        {channelList.map((item) => (
          <li key={item.id}>{item.name}</li>
        ))}
      </p>
    </div>
  )
}

export default App
